package com.minmin.common;

import lombok.extern.slf4j.Slf4j;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

@Slf4j
public class Alert {
    public boolean alert(WebDriver driver, String message) {
        try {
            driver.findElement(By.xpath("//p[text()=\"" + message + "\"]"));
            return true;
        } catch (Exception e) {
            log.error("操作失败:定位[{}]信息失败", message);
            log.error("失败原因:{}", e.toString());
            return false;
        }
    }
}
